package com.group.eams.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.group.eams.pojo.dto.PatentQueryDto;
import com.group.eams.pojo.entity.Patent;
import com.group.eams.pojo.vo.PatentListVo;
import com.group.eams.service.PatentService;
import com.group.eams.mapper.PatentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 恩哲欣
* @description 针对表【patent(无形资产(专利登记表))】的数据库操作Service实现
* @createDate 2024-10-29 16:09:34
*/
@Service
public class PatentServiceImpl extends ServiceImpl<PatentMapper, Patent> implements PatentService{

    @Autowired
    private PatentMapper patentMapper;

    /**
     * 根据查询条件查询专利信息
     * @param patentQueryDto
     * @return
     */
    @Override
    public Page<PatentListVo> findByQueryDto(PatentQueryDto patentQueryDto) {
        Page<PatentListVo> page = new Page<>(patentQueryDto.getPage(),patentQueryDto.getLimit());
        return patentMapper.findByQueryDto(page,patentQueryDto);
    }

    /**
     * 根据专利id查询专利信息
     *
     * @param id 专利id
     * @return 专利信息
     */
    @Override
    public PatentListVo findBasicById(Long id) {
        return patentMapper.findBasicById(id);
    }
}
